import request from '@/utils/request'

export function getElementPageList(params) {
  return request({
    url: '/sut/page',
    method: 'get',
    desc: '元素目录节点列表',
    params
  })
}

export function elementList(params) {
  return request({
    url: '/sut/page/element',
    method: 'get',
    desc: '元素列表',
    params
  })
}

export function elementEdit(data) {
  return request({
    url: '/sut/page/element?c=edit',
    method: 'post',
    desc: '编辑元素',
    paramType: 'formData',
    data
  })
}

export function elementDel(data) {
  return request({
    url: '/sut/page/element?c=del',
    method: 'post',
    desc: '删除元素',
    paramType: 'formData',
    data
  })
}

export function addNode(data) {
  return request({
    url: '/sut/page?c=addNode',
    method: 'post',
    desc: '新增元素节点',
    data
  })
}

export function editNode(data) {
  return request({
    url: '/sut/page?c=editNode',
    method: 'post',
    desc: '编辑元素节点',
    data
  })
}

export function delNode(data) {
  return request({
    url: '/sut/page?c=delNode',
    method: 'post',
    desc: '删除元素节点',
    data
  })
}

export function changeElementsPage(pageId, data) {
  return request({
    url: '/sut/page?c=changeElementsPage&pageId=' + pageId,
    method: 'post',
    desc: '变更元素所在页面',
    data
  })
}
